<template>
	<view class="item flex_c" :style="`background: url(${item.cover_img}) 0 0 no-repeat;`" :id="index % 2 == 0 ? 'margin14' : ''">
		<view class="top flex_center">
			<view class="tag1 flex_r_around" v-if="item.lab_type != 0">
				<!-- lab_type 标签类型：0=空，1=魅力榜1，2=魅力榜2，3=魅力榜3，4=新厅开业 -->
				<text class="hidden">{{
					item.lab_type == 1 ? '魅力榜No.1'
					: item.lab_type == 2 ? '魅力榜No.2'
					: item.lab_type == 3 ? '魅力榜No.3'
					: item.lab_type == 4 ? '新厅开业'
					: ''
				}}</text>
			</view>
			
			<view class="tag2 flex_r_around" v-if="item.tag_name">
				<text class="hidden">{{ item.tag_name }}</text>
			</view>
		</view>
		
		
		<view class="bottom">
			<view class="name hidden">{{ item.room_name || '' }}</view>
			<view class="people flex_r_between">
				<view class="left flex_center">
					<image :src="val.avatar" 
					v-for="(val,i) in item.watch_list" :key="i"
					mode="aspectFill" v-if="i < 3"></image>
				</view>
				
				<view class="right">
					{{ item.watch_list.length }}个人在线
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'live',
		props: {
			item: {
				type: Object,
				default: () => {},
			},
			index: {
				type: Number,
				default: 0,
			},
		},
		data() {
			return {
		
			}
		},
		data() {
			return {
				
			};
		}
	}
</script>

<style lang="less" scoped>
	.item {
		width: 352rpx;
		height: 352rpx;
		background-size: 100% !important;
		background: #D8D8D8;
		border-radius: 24rpx;
		overflow: hidden;
		margin-bottom: 14rpx;
		padding: 24rpx 0 0;
		justify-content: space-between;
		
		.top {
			width: 100%;
			padding: 0 24rpx;
			.tag1 {
				width: 120rpx;
				height: 40rpx;
				background: linear-gradient( 90deg, #C42FE0 0%, #FD2A53 100%);
				border-radius: 20rpx;
				border: 2rpx solid #FCC2D8;
				padding: 0 6rpx;
				margin-right: 24rpx;
				
				text {
					font-weight: 500;
					font-size: 20rpx;
					color: #FFFFFF;
				}
			}
			
			.tag2 {
				width: 104rpx;
				height: 40rpx;
				background: rgba(0,0,0,0.4);
				border-radius: 20rpx;
				backdrop-filter: blur(10px);
				text {
					font-weight: 500;
					font-size: 20rpx;
					color: #FFFFFF;
				}
			}
		}
		
		.bottom {
			padding: 0 24rpx;
			width: 100%;
			height: 216rpx;
			background: linear-gradient( 180deg, rgba(0,0,0,0) 0%, #000000 100%);
			padding-top: 90rpx;
			
			.name {
				font-weight: 500;
				font-size: 30rpx;
				color: #FFFFFF;
				line-height: 42rpx;
			}
			
			.people {
				margin-top: 16rpx;
				.left {
					image {
						width: 44rpx;
						height: 44rpx;
						border-radius: 22rpx;
						margin-right: -16rpx;
					}
				}
				.right {
					font-size: 22rpx;
					color: #FFFFFF;
					line-height: 32rpx;
				}
			}
		}
	}
	
	#margin14 {
		margin-right: 14rpx;
	}
</style>
